package com.weilai.common.service;

import com.weilai.common.dao.CarouselFigureMapper;
import com.weilai.common.model.CarouselFigure;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Song on 2017/6/15.
 */
@Service
public class CarouselFigureService {
    @Autowired
    CarouselFigureMapper carouselFigureMapper;

    public List<CarouselFigure> selectCarouselFigure(){
        List<CarouselFigure> carouselFigureList = carouselFigureMapper.selectCarouselFigure();
        return carouselFigureList;
    };

    public List<CarouselFigure> selectAllCarouselFigure() {
        List<CarouselFigure> carouselFigureList = carouselFigureMapper.selectAllCarouselFigure();
        return carouselFigureList;
    }


    public void delCarouselFigure(CarouselFigure carouselFigure) {
        carouselFigureMapper.deleteByPrimaryKey(carouselFigure.getId());
    }

    public void updateCarouselFigure(CarouselFigure carouselFigure) {
        carouselFigureMapper.updateByPrimaryKey(carouselFigure);
    }

    public int addCarouselFigure(CarouselFigure carouselFigure) {
        return carouselFigureMapper.insert(carouselFigure);
    }
}
